- /* simhcvdc.cpp by K.Tsuru */
- // function ID = 415 (reference) BRADIX
- /***********************************************
- SInteger class
- It provides a radix conversion BRADIX ---> DRADIX.
- The Horner's method is used.
- it is very slow.
- ************************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- SLong SInteger::HConvToDec() const{
- if(!Sign(415)) return 0.0;
- int j, N = (int)Head()+1;
- SLong result(DEC_INT, (uint)N);
- result.SetLong( (long)figure(N-1) ); // N >= 1
- for(j = N-2; j >= 0; j--){
- result = LsMult(result, BRADIX);
- result.LsAdd(figure(j));
- }
- result.SetSign(Sign());
- result.CutDown(POP);
- return result;
- }
simhcvdc.cpp : last modifiled at 2017/03/17 11:10:47(676 bytes)
created at 2016/04/25 14:53:17
The creation time of this html file is 2017/10/25 11:09:45 (Wed Oct 25 11:09:45 2017).